package com.surfilter.risk.entity;

/**
 * TopSearchCondition
 * Dis:
 * Created by grom on 2017/5/12.
 */
public class TopSearchCondition {
    //    处罚金额	punishMoney
    private String punishMoney;
    //    处罚次数  punishTotal
    private String punishTotal;
    //    年榜     punishYear
    private String year;
    //    月榜     punishMonth
    private String month;
    //    关键词 keyWord
    private String company;
    //    行业     industryType
    private String industryType;
    //    地理位置      position
    private String position;
    //    行政单位      authority
    private String authority;
    //接收省份id
    private Integer positionId;
    //每页显示记录数   pageSize
    private Integer pageSize;
    //当前页数	pageNumber
    private Integer pageNumber;
    //总页数	totalPage
    private Integer totalPage;
    //总记录数	totalRow
    private Integer totalRow;

    //分页开始
    private Integer begin;
    //分页结束
    private Integer end;

    public String getPunishMoney() {
        return punishMoney;
    }

    public void setPunishMoney(String punishMoney) {
        this.punishMoney = punishMoney;
    }

    public String getPunishTotal() {
        return punishTotal;
    }

    public void setPunishTotal(String punishTotal) {
        this.punishTotal = punishTotal;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getMonth() {
        return month;
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public void setTotalRow(Integer totalRow) {
        this.totalRow = totalRow;
    }

    public String getIndustryType() {
        return industryType;
    }

    public void setIndustryType(String industryType) {
        this.industryType = industryType;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public Integer getPositionId() {
        return positionId;
    }

    public void setPositionId(Integer positionId) {
        this.positionId = positionId;
    }

    public String getAuthority() {
        return authority;
    }

    public void setAuthority(String authority) {
        this.authority = authority;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if(null == pageSize){
            pageSize = 10;
        }
        this.pageSize = pageSize;
    }

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        if(null == pageNumber){
            pageNumber = 1;
        }
        this.pageNumber = pageNumber;
    }

    public Integer getTotalPage() {
        // 根据总行数，计算总页数
        if (totalRow % pageSize == 0) {
            totalPage = totalRow / pageSize;
        } else {
            totalPage = totalRow / pageSize + 1;
        }
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getTotalRow() {
        return totalRow;
    }

    public Integer getBegin() {
        begin = (pageNumber - 1) * pageSize;
        return begin;
    }

    public void setBegin(Integer begin) {
        this.begin = begin;
    }

    public Integer getEnd() {
        end = pageNumber * pageSize + 1;
        return end;
    }

    public void setEnd(Integer end) {
        this.end = end;
    }
    @Override
    public String toString() {
        return "TopSearchCondition{" +
                "punishMoney='" + punishMoney + '\'' +
                ", punishTotal='" + punishTotal + '\'' +
                ", year=" + year +
                ", month=" + month +
                ", keyWord='" + company + '\'' +
                ", industryType='" + industryType + '\'' +
                ", position='" + position + '\'' +
                ", authority='" + authority + '\'' +
                ", pageSize=" + pageSize +
                ", pageNumber=" + pageNumber +
                ", totalPage=" + totalPage +
                ", totalRow=" + totalRow +
                ", begin=" + begin+
                ", end=" + end +
                ", positionId=" + positionId +
                '}';
    }
}
